/*
 * Copyright 2010-2018 MediaTek, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * Version 2 as published by the Free Software Foundation.
 */
#ifndef __MTK_GPIO_H__
#define __MTK_GPIO_H__

/* Error Code No. */
#define RSUCCESS        0
#define ERACCESS        1
#define ERINVAL         2
#define ERWRAPPER       3

#define GPIO_WR32(addr, data)   ((*(volatile unsigned long*)(addr)) = (unsigned long)(data))
#define GPIO_RD32(addr)         (*(volatile unsigned long * const)(addr))
#define GPIO_SET_BITS(BIT,REG)   ((*(volatile unsigned long*)(REG)) = (unsigned long)(BIT))
#define GPIO_CLR_BITS(BIT,REG)   ((*(volatile unsigned long*)(REG)) &= ~((unsigned long)(BIT)))

typedef enum {
	GPIO_UNSUPPORTED = -1,
	GPIO0 = 0,
	GPIO1, GPIO2, GPIO3, GPIO4, GPIO5, GPIO6, GPIO7,
	GPIO8, GPIO9, GPIO10, GPIO11, GPIO12, GPIO13, GPIO14, GPIO15,
	GPIO16, GPIO17, GPIO18, GPIO19, GPIO20, GPIO21, GPIO22, GPIO23,
	GPIO24, GPIO25, GPIO26, GPIO27, GPIO28, GPIO29, GPIO30, GPIO31,
	GPIO32, GPIO33, GPIO34, GPIO35, GPIO36, GPIO37, GPIO38, GPIO39,
	GPIO40, GPIO41, GPIO42, GPIO43, GPIO44, GPIO45, GPIO46, GPIO47,
	GPIO48, GPIO49, GPIO50, GPIO51, GPIO52, GPIO53, GPIO54, GPIO55,
	GPIO56, GPIO57, GPIO58, GPIO59, GPIO60, GPIO61, GPIO62, GPIO63,
	GPIO64, GPIO65, GPIO66, GPIO67, GPIO68, GPIO69, GPIO70, GPIO71,
	GPIO72, GPIO73, GPIO74, GPIO75, GPIO76, GPIO77, GPIO78, MT_GPIO_BASE_MAX
} GPIO_PIN;

#define MAX_GPIO_PIN    (MT_GPIO_BASE_MAX)

/* GPIO MODE CONTROL VALUE*/
typedef enum {
	GPIO_MODE_UNSUPPORTED = -1,
	GPIO_MODE_GPIO  = 0,
	GPIO_MODE_00    = 0,
	GPIO_MODE_01    = 1,
	GPIO_MODE_02    = 2,
	GPIO_MODE_03    = 3,
	GPIO_MODE_04    = 4,
	GPIO_MODE_05    = 5,
	GPIO_MODE_06    = 6,
	GPIO_MODE_07    = 7,

	GPIO_MODE_MAX,
	GPIO_MODE_DEFAULT = GPIO_MODE_01,
} GPIO_MODE;

/* GPIO DIRECTION */
typedef enum {
	GPIO_DIR_UNSUPPORTED = -1,
	GPIO_DIR_IN     = 0,
	GPIO_DIR_OUT    = 1,

	GPIO_DIR_MAX,
	GPIO_DIR_DEFAULT = GPIO_DIR_IN,
} GPIO_DIR;

/* GPIO PULL ENABLE*/
typedef enum {
	GPIO_PULL_EN_UNSUPPORTED = -1,
	GPIO_PULL_DISABLE = 0,
	GPIO_PULL_ENABLE  = 1,

	GPIO_PULL_EN_MAX,
	GPIO_PULL_EN_DEFAULT = GPIO_PULL_ENABLE,
} GPIO_PULL_EN;

/* GPIO SMT*/
typedef enum {
	GPIO_SMT_UNSUPPORTED = -1,
	GPIO_SMT_DISABLE = 0,
	GPIO_SMT_ENABLE  = 1,

	GPIO_SMT_MAX,
	GPIO_SMT_DEFAULT = GPIO_SMT_ENABLE,
} GPIO_SMT;

/* GPIO PULL-UP/PULL-DOWN*/
typedef enum {
	GPIO_PULL_UNSUPPORTED = -1,
	GPIO_PULL_DOWN  = 0,
	GPIO_PULL_UP    = 1,

	GPIO_PULL_MAX,
	GPIO_PULL_DEFAULT = GPIO_PULL_DOWN
} GPIO_PULL;

/* GPIO OUTPUT */
typedef enum {
	GPIO_OUT_UNSUPPORTED = -1,
	GPIO_OUT_ZERO = 0,
	GPIO_OUT_ONE  = 1,

	GPIO_OUT_MAX,
	GPIO_OUT_DEFAULT = GPIO_OUT_ZERO,
	GPIO_DATA_OUT_DEFAULT = GPIO_OUT_ZERO,
} GPIO_OUT;

/* GPIO INPUT */
typedef enum {
	GPIO_IN_UNSUPPORTED = -1,
	GPIO_IN_ZERO = 0,
	GPIO_IN_ONE  = 1,

	GPIO_IN_MAX,
} GPIO_IN;

typedef enum {
	GPIO_DRIVE_UNSUPPORTED = -1,
	MTK_DRIVE_4mA    = 0,
	MTK_DRIVE_8mA    = 2,
	MTK_DRIVE_12mA    = 4,
	MTK_DRIVE_16mA    = 6,

	GPIO_DRIVE_MAX,
	GPIO_DRIVE_DEFAULT = MTK_DRIVE_4mA,
} GPIO_DRIVE;

/**
 * struct mt_pin_info - For all pins' setting.
 * @pin: The pin number.
 * @offset: The offset of pin setting register.
 * @bit: The offset of setting value register.
 * @width: The width of setting bit.
 * @ip_num: The IP number of setting register use.
 */
struct mtk_pin_info {
	unsigned int pin;
	unsigned int offset;
	unsigned char bit;
	unsigned char width;
	unsigned char ip_num;
};

#define MTK_PIN_INFO(_pin, _offset, _bit, _width, _ip_num)	\
{	\
	.pin = _pin,	\
	.offset = _offset,	\
	.bit = _bit, \
	.width = _width, \
	.ip_num = _ip_num,\
}

static const struct mtk_pin_info mtk_pin_info_mode[] = {
	MTK_PIN_INFO(0, 0x7300, 0, 4, 0),
	MTK_PIN_INFO(1, 0x7300, 4, 4, 0),
	MTK_PIN_INFO(2, 0x7300, 8, 4, 0),
	MTK_PIN_INFO(3, 0x7300, 12, 4, 0),
	MTK_PIN_INFO(4, 0x7300, 16, 4, 0),
	MTK_PIN_INFO(5, 0x7300, 20, 4, 0),
	MTK_PIN_INFO(6, 0x7300, 24, 4, 0),
	MTK_PIN_INFO(7, 0x7300, 28, 4, 0),
	MTK_PIN_INFO(8, 0x7310, 0, 4, 0),
	MTK_PIN_INFO(9, 0x7310, 4, 4, 0),
	MTK_PIN_INFO(10, 0x7310, 8, 4, 0),
	MTK_PIN_INFO(11, 0x7310, 12, 4, 0),
	MTK_PIN_INFO(12, 0x7310, 16, 4, 0),
	MTK_PIN_INFO(13, 0x7310, 20, 4, 0),
	MTK_PIN_INFO(14, 0x7310, 24, 4, 0),
	MTK_PIN_INFO(15, 0x7310, 28, 4, 0),
	MTK_PIN_INFO(16, 0x7320, 0, 4, 0),
	MTK_PIN_INFO(17, 0x7320, 4, 4, 0),
	MTK_PIN_INFO(18, 0x7320, 8, 4, 0),
	MTK_PIN_INFO(19, 0x7320, 12, 4, 0),
	MTK_PIN_INFO(20, 0x7320, 16, 4, 0),
	MTK_PIN_INFO(21, 0x7320, 20, 4, 0),
	MTK_PIN_INFO(22, 0x7320, 24, 4, 0),
	MTK_PIN_INFO(23, 0x7320, 28, 4, 0),
	MTK_PIN_INFO(24, 0x7330, 0, 4, 0),
	MTK_PIN_INFO(25, 0x7330, 4, 4, 0),
	MTK_PIN_INFO(26, 0x7330, 8, 4, 0),
	MTK_PIN_INFO(27, 0x7330, 12, 4, 0),
	MTK_PIN_INFO(28, 0x7330, 16, 4, 0),
	MTK_PIN_INFO(29, 0x7330, 20, 4, 0),
	MTK_PIN_INFO(30, 0x7330, 24, 4, 0),
	MTK_PIN_INFO(31, 0x7330, 28, 4, 0),
	MTK_PIN_INFO(32, 0x7340, 0, 4, 0),
	MTK_PIN_INFO(33, 0x7340, 4, 4, 0),
	MTK_PIN_INFO(34, 0x7340, 8, 4, 0),
	MTK_PIN_INFO(35, 0x7340, 12, 4, 0),
	MTK_PIN_INFO(36, 0x7340, 16, 4, 0),
	MTK_PIN_INFO(37, 0x7340, 20, 4, 0),
	MTK_PIN_INFO(38, 0x7340, 24, 4, 0),
	MTK_PIN_INFO(39, 0x7340, 28, 4, 0),
	MTK_PIN_INFO(40, 0x7350, 0, 4, 0),
	MTK_PIN_INFO(41, 0x7350, 4, 4, 0),
	MTK_PIN_INFO(42, 0x7350, 8, 4, 0),
	MTK_PIN_INFO(43, 0x7350, 12, 4, 0),
	MTK_PIN_INFO(44, 0x7350, 16, 4, 0),
	MTK_PIN_INFO(45, 0x7350, 20, 4, 0),
	MTK_PIN_INFO(46, 0x7350, 24, 4, 0),
	MTK_PIN_INFO(47, 0x7350, 28, 4, 0),
	MTK_PIN_INFO(48, 0x7360, 0, 4, 0),
	MTK_PIN_INFO(49, 0x7360, 4, 4, 0),
	MTK_PIN_INFO(50, 0x7360, 8, 4, 0),
	MTK_PIN_INFO(51, 0x7360, 12, 4, 0),
	MTK_PIN_INFO(52, 0x7360, 16, 4, 0),
	MTK_PIN_INFO(53, 0x7360, 20, 4, 0),
	MTK_PIN_INFO(54, 0x7360, 24, 4, 0),
	MTK_PIN_INFO(55, 0x7360, 28, 4, 0),
	MTK_PIN_INFO(56, 0x7370, 0, 4, 0),
	MTK_PIN_INFO(57, 0x7370, 4, 4, 0),
	MTK_PIN_INFO(58, 0x7370, 8, 4, 0),
	MTK_PIN_INFO(59, 0x7370, 12, 4, 0),
	MTK_PIN_INFO(60, 0x7370, 16, 4, 0),
	MTK_PIN_INFO(61, 0x7370, 20, 4, 0),
	MTK_PIN_INFO(62, 0x7370, 24, 4, 0),
	MTK_PIN_INFO(63, 0x7370, 28, 4, 0),
	MTK_PIN_INFO(64, 0x7380, 0, 4, 0),
	MTK_PIN_INFO(65, 0x7380, 4, 4, 0),
	MTK_PIN_INFO(66, 0x7380, 8, 4, 0),
	MTK_PIN_INFO(67, 0x7380, 12, 4, 0),
	MTK_PIN_INFO(68, 0x7380, 16, 4, 0),
	MTK_PIN_INFO(69, 0x7380, 20, 4, 0),
	MTK_PIN_INFO(70, 0x7380, 24, 4, 0),
	MTK_PIN_INFO(71, 0x7380, 28, 4, 0),
	MTK_PIN_INFO(72, 0x7390, 0, 4, 0),
	MTK_PIN_INFO(73, 0x7390, 4, 4, 0),
	MTK_PIN_INFO(74, 0x7390, 8, 4, 0),
	MTK_PIN_INFO(75, 0x7390, 12, 4, 0),
	MTK_PIN_INFO(76, 0x7390, 16, 4, 0),
	MTK_PIN_INFO(77, 0x7390, 20, 4, 0),
	MTK_PIN_INFO(78, 0x7390, 24, 4, 0),
};

static const struct mtk_pin_info mtk_pin_info_dir[] = {
	MTK_PIN_INFO(0, 0x7000, 0, 1, 0),
	MTK_PIN_INFO(1, 0x7000, 1, 1, 0),
	MTK_PIN_INFO(2, 0x7000, 2, 1, 0),
	MTK_PIN_INFO(3, 0x7000, 3, 1, 0),
	MTK_PIN_INFO(4, 0x7000, 4, 1, 0),
	MTK_PIN_INFO(5, 0x7000, 5, 1, 0),
	MTK_PIN_INFO(6, 0x7000, 6, 1, 0),
	MTK_PIN_INFO(7, 0x7000, 7, 1, 0),
	MTK_PIN_INFO(8, 0x7000, 8, 1, 0),
	MTK_PIN_INFO(9, 0x7000, 9, 1, 0),
	MTK_PIN_INFO(10, 0x7000, 10, 1, 0),
	MTK_PIN_INFO(11, 0x7000, 11, 1, 0),
	MTK_PIN_INFO(12, 0x7000, 12, 1, 0),
	MTK_PIN_INFO(13, 0x7000, 13, 1, 0),
	MTK_PIN_INFO(14, 0x7000, 14, 1, 0),
	MTK_PIN_INFO(15, 0x7000, 15, 1, 0),
	MTK_PIN_INFO(16, 0x7000, 16, 1, 0),
	MTK_PIN_INFO(17, 0x7000, 17, 1, 0),
	MTK_PIN_INFO(18, 0x7000, 18, 1, 0),
	MTK_PIN_INFO(19, 0x7000, 19, 1, 0),
	MTK_PIN_INFO(20, 0x7000, 20, 1, 0),
	MTK_PIN_INFO(21, 0x7000, 21, 1, 0),
	MTK_PIN_INFO(22, 0x7000, 22, 1, 0),
	MTK_PIN_INFO(23, 0x7000, 23, 1, 0),
	MTK_PIN_INFO(24, 0x7000, 24, 1, 0),
	MTK_PIN_INFO(25, 0x7000, 25, 1, 0),
	MTK_PIN_INFO(26, 0x7000, 26, 1, 0),
	MTK_PIN_INFO(27, 0x7000, 27, 1, 0),
	MTK_PIN_INFO(28, 0x7000, 28, 1, 0),
	MTK_PIN_INFO(29, 0x7000, 29, 1, 0),
	MTK_PIN_INFO(30, 0x7000, 30, 1, 0),
	MTK_PIN_INFO(31, 0x7000, 31, 1, 0),
	MTK_PIN_INFO(32, 0x7010, 0, 1, 0),
	MTK_PIN_INFO(33, 0x7010, 1, 1, 0),
	MTK_PIN_INFO(34, 0x7010, 2, 1, 0),
	MTK_PIN_INFO(35, 0x7010, 3, 1, 0),
	MTK_PIN_INFO(36, 0x7010, 4, 1, 0),
	MTK_PIN_INFO(37, 0x7010, 5, 1, 0),
	MTK_PIN_INFO(38, 0x7010, 6, 1, 0),
	MTK_PIN_INFO(39, 0x7010, 7, 1, 0),
	MTK_PIN_INFO(40, 0x7010, 8, 1, 0),
	MTK_PIN_INFO(41, 0x7010, 9, 1, 0),
	MTK_PIN_INFO(42, 0x7010, 10, 1, 0),
	MTK_PIN_INFO(43, 0x7010, 11, 1, 0),
	MTK_PIN_INFO(44, 0x7010, 12, 1, 0),
	MTK_PIN_INFO(45, 0x7010, 13, 1, 0),
	MTK_PIN_INFO(46, 0x7010, 14, 1, 0),
	MTK_PIN_INFO(47, 0x7010, 15, 1, 0),
	MTK_PIN_INFO(48, 0x7010, 16, 1, 0),
	MTK_PIN_INFO(49, 0x7010, 17, 1, 0),
	MTK_PIN_INFO(50, 0x7010, 18, 1, 0),
	MTK_PIN_INFO(51, 0x7010, 19, 1, 0),
	MTK_PIN_INFO(52, 0x7010, 20, 1, 0),
	MTK_PIN_INFO(53, 0x7010, 21, 1, 0),
	MTK_PIN_INFO(54, 0x7010, 22, 1, 0),
	MTK_PIN_INFO(55, 0x7010, 23, 1, 0),
	MTK_PIN_INFO(56, 0x7010, 24, 1, 0),
	MTK_PIN_INFO(57, 0x7010, 25, 1, 0),
	MTK_PIN_INFO(58, 0x7010, 26, 1, 0),
	MTK_PIN_INFO(59, 0x7010, 27, 1, 0),
	MTK_PIN_INFO(60, 0x7010, 28, 1, 0),
	MTK_PIN_INFO(61, 0x7010, 29, 1, 0),
	MTK_PIN_INFO(62, 0x7010, 30, 1, 0),
	MTK_PIN_INFO(63, 0x7010, 31, 1, 0),
	MTK_PIN_INFO(64, 0x7020, 0, 1, 0),
	MTK_PIN_INFO(65, 0x7020, 1, 1, 0),
	MTK_PIN_INFO(66, 0x7020, 2, 1, 0),
	MTK_PIN_INFO(67, 0x7020, 3, 1, 0),
	MTK_PIN_INFO(68, 0x7020, 4, 1, 0),
	MTK_PIN_INFO(69, 0x7020, 5, 1, 0),
	MTK_PIN_INFO(70, 0x7020, 6, 1, 0),
	MTK_PIN_INFO(71, 0x7020, 7, 1, 0),
	MTK_PIN_INFO(72, 0x7020, 8, 1, 0),
	MTK_PIN_INFO(73, 0x7020, 9, 1, 0),
	MTK_PIN_INFO(74, 0x7020, 10, 1, 0),
	MTK_PIN_INFO(75, 0x7020, 11, 1, 0),
	MTK_PIN_INFO(76, 0x7020, 12, 1, 0),
	MTK_PIN_INFO(77, 0x7020, 13, 1, 0),
	MTK_PIN_INFO(78, 0x7020, 14, 1, 0),
};

static const struct mtk_pin_info mtk_pin_info_datain[] = {
	MTK_PIN_INFO(0, 0x7200, 0, 1, 0),
	MTK_PIN_INFO(1, 0x7200, 1, 1, 0),
	MTK_PIN_INFO(2, 0x7200, 2, 1, 0),
	MTK_PIN_INFO(3, 0x7200, 3, 1, 0),
	MTK_PIN_INFO(4, 0x7200, 4, 1, 0),
	MTK_PIN_INFO(5, 0x7200, 5, 1, 0),
	MTK_PIN_INFO(6, 0x7200, 6, 1, 0),
	MTK_PIN_INFO(7, 0x7200, 7, 1, 0),
	MTK_PIN_INFO(8, 0x7200, 8, 1, 0),
	MTK_PIN_INFO(9, 0x7200, 9, 1, 0),
	MTK_PIN_INFO(10, 0x7200, 10, 1, 0),
	MTK_PIN_INFO(11, 0x7200, 11, 1, 0),
	MTK_PIN_INFO(12, 0x7200, 12, 1, 0),
	MTK_PIN_INFO(13, 0x7200, 13, 1, 0),
	MTK_PIN_INFO(14, 0x7200, 14, 1, 0),
	MTK_PIN_INFO(15, 0x7200, 15, 1, 0),
	MTK_PIN_INFO(16, 0x7200, 16, 1, 0),
	MTK_PIN_INFO(17, 0x7200, 17, 1, 0),
	MTK_PIN_INFO(18, 0x7200, 18, 1, 0),
	MTK_PIN_INFO(19, 0x7200, 19, 1, 0),
	MTK_PIN_INFO(20, 0x7200, 20, 1, 0),
	MTK_PIN_INFO(21, 0x7200, 21, 1, 0),
	MTK_PIN_INFO(22, 0x7200, 22, 1, 0),
	MTK_PIN_INFO(23, 0x7200, 23, 1, 0),
	MTK_PIN_INFO(24, 0x7200, 24, 1, 0),
	MTK_PIN_INFO(25, 0x7200, 25, 1, 0),
	MTK_PIN_INFO(26, 0x7200, 26, 1, 0),
	MTK_PIN_INFO(27, 0x7200, 27, 1, 0),
	MTK_PIN_INFO(28, 0x7200, 28, 1, 0),
	MTK_PIN_INFO(29, 0x7200, 29, 1, 0),
	MTK_PIN_INFO(30, 0x7200, 30, 1, 0),
	MTK_PIN_INFO(31, 0x7200, 31, 1, 0),
	MTK_PIN_INFO(32, 0x7210, 0, 1, 0),
	MTK_PIN_INFO(33, 0x7210, 1, 1, 0),
	MTK_PIN_INFO(34, 0x7210, 2, 1, 0),
	MTK_PIN_INFO(35, 0x7210, 3, 1, 0),
	MTK_PIN_INFO(36, 0x7210, 4, 1, 0),
	MTK_PIN_INFO(37, 0x7210, 5, 1, 0),
	MTK_PIN_INFO(38, 0x7210, 6, 1, 0),
	MTK_PIN_INFO(39, 0x7210, 7, 1, 0),
	MTK_PIN_INFO(40, 0x7210, 8, 1, 0),
	MTK_PIN_INFO(41, 0x7210, 9, 1, 0),
	MTK_PIN_INFO(42, 0x7210, 10, 1, 0),
	MTK_PIN_INFO(43, 0x7210, 11, 1, 0),
	MTK_PIN_INFO(44, 0x7210, 12, 1, 0),
	MTK_PIN_INFO(45, 0x7210, 13, 1, 0),
	MTK_PIN_INFO(46, 0x7210, 14, 1, 0),
	MTK_PIN_INFO(47, 0x7210, 15, 1, 0),
	MTK_PIN_INFO(48, 0x7210, 16, 1, 0),
	MTK_PIN_INFO(49, 0x7210, 17, 1, 0),
	MTK_PIN_INFO(50, 0x7210, 18, 1, 0),
	MTK_PIN_INFO(51, 0x7210, 19, 1, 0),
	MTK_PIN_INFO(52, 0x7210, 20, 1, 0),
	MTK_PIN_INFO(53, 0x7210, 21, 1, 0),
	MTK_PIN_INFO(54, 0x7210, 22, 1, 0),
	MTK_PIN_INFO(55, 0x7210, 23, 1, 0),
	MTK_PIN_INFO(56, 0x7210, 24, 1, 0),
	MTK_PIN_INFO(57, 0x7210, 25, 1, 0),
	MTK_PIN_INFO(58, 0x7210, 26, 1, 0),
	MTK_PIN_INFO(59, 0x7210, 27, 1, 0),
	MTK_PIN_INFO(60, 0x7210, 28, 1, 0),
	MTK_PIN_INFO(61, 0x7210, 29, 1, 0),
	MTK_PIN_INFO(62, 0x7210, 30, 1, 0),
	MTK_PIN_INFO(63, 0x7210, 31, 1, 0),
	MTK_PIN_INFO(64, 0x7220, 0, 1, 0),
	MTK_PIN_INFO(65, 0x7220, 1, 1, 0),
	MTK_PIN_INFO(66, 0x7220, 2, 1, 0),
	MTK_PIN_INFO(67, 0x7220, 3, 1, 0),
	MTK_PIN_INFO(68, 0x7220, 4, 1, 0),
	MTK_PIN_INFO(69, 0x7220, 5, 1, 0),
	MTK_PIN_INFO(70, 0x7220, 6, 1, 0),
	MTK_PIN_INFO(71, 0x7220, 7, 1, 0),
	MTK_PIN_INFO(72, 0x7220, 8, 1, 0),
	MTK_PIN_INFO(73, 0x7220, 9, 1, 0),
	MTK_PIN_INFO(74, 0x7220, 10, 1, 0),
	MTK_PIN_INFO(75, 0x7220, 11, 1, 0),
	MTK_PIN_INFO(76, 0x7220, 12, 1, 0),
	MTK_PIN_INFO(77, 0x7220, 13, 1, 0),
	MTK_PIN_INFO(78, 0x7220, 14, 1, 0),
};

static const struct mtk_pin_info mtk_pin_info_dataout[] = {
	MTK_PIN_INFO(0, 0x7100, 0, 1, 0),
	MTK_PIN_INFO(1, 0x7100, 1, 1, 0),
	MTK_PIN_INFO(2, 0x7100, 2, 1, 0),
	MTK_PIN_INFO(3, 0x7100, 3, 1, 0),
	MTK_PIN_INFO(4, 0x7100, 4, 1, 0),
	MTK_PIN_INFO(5, 0x7100, 5, 1, 0),
	MTK_PIN_INFO(6, 0x7100, 6, 1, 0),
	MTK_PIN_INFO(7, 0x7100, 7, 1, 0),
	MTK_PIN_INFO(8, 0x7100, 8, 1, 0),
	MTK_PIN_INFO(9, 0x7100, 9, 1, 0),
	MTK_PIN_INFO(10, 0x7100, 10, 1, 0),
	MTK_PIN_INFO(11, 0x7100, 11, 1, 0),
	MTK_PIN_INFO(12, 0x7100, 12, 1, 0),
	MTK_PIN_INFO(13, 0x7100, 13, 1, 0),
	MTK_PIN_INFO(14, 0x7100, 14, 1, 0),
	MTK_PIN_INFO(15, 0x7100, 15, 1, 0),
	MTK_PIN_INFO(16, 0x7100, 16, 1, 0),
	MTK_PIN_INFO(17, 0x7100, 17, 1, 0),
	MTK_PIN_INFO(18, 0x7100, 18, 1, 0),
	MTK_PIN_INFO(19, 0x7100, 19, 1, 0),
	MTK_PIN_INFO(20, 0x7100, 20, 1, 0),
	MTK_PIN_INFO(21, 0x7100, 21, 1, 0),
	MTK_PIN_INFO(22, 0x7100, 22, 1, 0),
	MTK_PIN_INFO(23, 0x7100, 23, 1, 0),
	MTK_PIN_INFO(24, 0x7100, 24, 1, 0),
	MTK_PIN_INFO(25, 0x7100, 25, 1, 0),
	MTK_PIN_INFO(26, 0x7100, 26, 1, 0),
	MTK_PIN_INFO(27, 0x7100, 27, 1, 0),
	MTK_PIN_INFO(28, 0x7100, 28, 1, 0),
	MTK_PIN_INFO(29, 0x7100, 29, 1, 0),
	MTK_PIN_INFO(30, 0x7100, 30, 1, 0),
	MTK_PIN_INFO(31, 0x7100, 31, 1, 0),
	MTK_PIN_INFO(32, 0x7110, 0, 1, 0),
	MTK_PIN_INFO(33, 0x7110, 1, 1, 0),
	MTK_PIN_INFO(34, 0x7110, 2, 1, 0),
	MTK_PIN_INFO(35, 0x7110, 3, 1, 0),
	MTK_PIN_INFO(36, 0x7110, 4, 1, 0),
	MTK_PIN_INFO(37, 0x7110, 5, 1, 0),
	MTK_PIN_INFO(38, 0x7110, 6, 1, 0),
	MTK_PIN_INFO(39, 0x7110, 7, 1, 0),
	MTK_PIN_INFO(40, 0x7110, 8, 1, 0),
	MTK_PIN_INFO(41, 0x7110, 9, 1, 0),
	MTK_PIN_INFO(42, 0x7110, 10, 1, 0),
	MTK_PIN_INFO(43, 0x7110, 11, 1, 0),
	MTK_PIN_INFO(44, 0x7110, 12, 1, 0),
	MTK_PIN_INFO(45, 0x7110, 13, 1, 0),
	MTK_PIN_INFO(46, 0x7110, 14, 1, 0),
	MTK_PIN_INFO(47, 0x7110, 15, 1, 0),
	MTK_PIN_INFO(48, 0x7110, 16, 1, 0),
	MTK_PIN_INFO(49, 0x7110, 17, 1, 0),
	MTK_PIN_INFO(50, 0x7110, 18, 1, 0),
	MTK_PIN_INFO(51, 0x7110, 19, 1, 0),
	MTK_PIN_INFO(52, 0x7110, 20, 1, 0),
	MTK_PIN_INFO(53, 0x7110, 21, 1, 0),
	MTK_PIN_INFO(54, 0x7110, 22, 1, 0),
	MTK_PIN_INFO(55, 0x7110, 23, 1, 0),
	MTK_PIN_INFO(56, 0x7110, 24, 1, 0),
	MTK_PIN_INFO(57, 0x7110, 25, 1, 0),
	MTK_PIN_INFO(58, 0x7110, 26, 1, 0),
	MTK_PIN_INFO(59, 0x7110, 27, 1, 0),
	MTK_PIN_INFO(60, 0x7110, 28, 1, 0),
	MTK_PIN_INFO(61, 0x7110, 29, 1, 0),
	MTK_PIN_INFO(62, 0x7110, 30, 1, 0),
	MTK_PIN_INFO(63, 0x7110, 31, 1, 0),
	MTK_PIN_INFO(64, 0x7120, 0, 1, 0),
	MTK_PIN_INFO(65, 0x7120, 1, 1, 0),
	MTK_PIN_INFO(66, 0x7120, 2, 1, 0),
	MTK_PIN_INFO(67, 0x7120, 3, 1, 0),
	MTK_PIN_INFO(68, 0x7120, 4, 1, 0),
	MTK_PIN_INFO(69, 0x7120, 5, 1, 0),
	MTK_PIN_INFO(70, 0x7120, 6, 1, 0),
	MTK_PIN_INFO(71, 0x7120, 7, 1, 0),
	MTK_PIN_INFO(72, 0x7120, 8, 1, 0),
	MTK_PIN_INFO(73, 0x7120, 9, 1, 0),
	MTK_PIN_INFO(74, 0x7120, 10, 1, 0),
	MTK_PIN_INFO(75, 0x7120, 11, 1, 0),
	MTK_PIN_INFO(76, 0x7120, 12, 1, 0),
	MTK_PIN_INFO(77, 0x7120, 13, 1, 0),
	MTK_PIN_INFO(78, 0x7120, 14, 1, 0),
};

static const struct mtk_pin_info mtk_pin_info_ies[] = {
	MTK_PIN_INFO(0, 0x8000, 0, 1, 0),
	MTK_PIN_INFO(1, 0x8000, 1, 1, 0),
	MTK_PIN_INFO(2, 0x8000, 2, 1, 0),
	MTK_PIN_INFO(3, 0x8000, 3, 1, 0),
	MTK_PIN_INFO(4, 0x8000, 4, 1, 0),
	MTK_PIN_INFO(5, 0x8000, 5, 1, 0),
	MTK_PIN_INFO(6, 0x8000, 6, 1, 0),
	MTK_PIN_INFO(7, 0x8000, 7, 1, 0),
	MTK_PIN_INFO(8, 0x8000, 8, 1, 0),
	MTK_PIN_INFO(9, 0x8000, 9, 1, 0),
	MTK_PIN_INFO(10, 0x8000, 10, 1, 0),
	MTK_PIN_INFO(11, 0x9000, 0, 1, 0),
	MTK_PIN_INFO(12, 0x9000, 1, 1, 0),
	MTK_PIN_INFO(13, 0x9000, 2, 1, 0),
	MTK_PIN_INFO(14, 0x9000, 3, 1, 0),
	MTK_PIN_INFO(15, 0x9000, 4, 1, 0),
	MTK_PIN_INFO(16, 0x9000, 5, 1, 0),
	MTK_PIN_INFO(17, 0x9000, 6, 1, 0),
	MTK_PIN_INFO(18, 0x9000, 7, 1, 0),
	MTK_PIN_INFO(19, 0xa000, 0, 1, 0),
	MTK_PIN_INFO(20, 0xa000, 1, 1, 0),
	MTK_PIN_INFO(21, 0xa000, 2, 1, 0),
	MTK_PIN_INFO(22, 0xa000, 3, 1, 0),
	MTK_PIN_INFO(23, 0xa000, 4, 1, 0),
	MTK_PIN_INFO(24, 0xa000, 5, 1, 0),
	MTK_PIN_INFO(25, 0xa000, 6, 1, 0),
	MTK_PIN_INFO(26, 0xa000, 7, 1, 0),
	MTK_PIN_INFO(27, 0xa000, 8, 1, 0),
	MTK_PIN_INFO(28, 0xa000, 9, 1, 0),
	MTK_PIN_INFO(29, 0xa000, 10, 1, 0),
	MTK_PIN_INFO(30, 0xa000, 11, 1, 0),
	MTK_PIN_INFO(31, 0xa000, 12, 1, 0),
	MTK_PIN_INFO(32, 0xa000, 13, 1, 0),
	MTK_PIN_INFO(33, 0xb000, 0, 1, 0),
	MTK_PIN_INFO(34, 0xb000, 1, 1, 0),
	MTK_PIN_INFO(35, 0xb000, 2, 1, 0),
	MTK_PIN_INFO(36, 0xb000, 3, 1, 0),
	MTK_PIN_INFO(37, 0xb000, 4, 1, 0),
	MTK_PIN_INFO(38, 0xb000, 5, 1, 0),
	MTK_PIN_INFO(39, 0xb000, 6, 1, 0),
	MTK_PIN_INFO(40, 0xb000, 7, 1, 0),
	MTK_PIN_INFO(41, 0xb000, 8, 1, 0),
	MTK_PIN_INFO(42, 0xb000, 9, 1, 0),
	MTK_PIN_INFO(43, 0xb000, 10, 1, 0),
	MTK_PIN_INFO(44, 0xb000, 11, 1, 0),
	MTK_PIN_INFO(45, 0xb000, 12, 1, 0),
	MTK_PIN_INFO(46, 0xb000, 13, 1, 0),
	MTK_PIN_INFO(47, 0xb000, 14, 1, 0),
	MTK_PIN_INFO(48, 0xb000, 15, 1, 0),
	MTK_PIN_INFO(49, 0xc000, 0, 1, 0),
	MTK_PIN_INFO(50, 0xc000, 1, 1, 0),
	MTK_PIN_INFO(51, 0xd000, 0, 1, 0),
	MTK_PIN_INFO(52, 0xd000, 1, 1, 0),
	MTK_PIN_INFO(53, 0xd000, 2, 1, 0),
	MTK_PIN_INFO(54, 0xd000, 3, 1, 0),
	MTK_PIN_INFO(55, 0xd000, 4, 1, 0),
	MTK_PIN_INFO(56, 0xd000, 5, 1, 0),
	MTK_PIN_INFO(57, 0xd000, 6, 1, 0),
	MTK_PIN_INFO(58, 0xd000, 7, 1, 0),
	MTK_PIN_INFO(59, 0xd000, 8, 1, 0),
	MTK_PIN_INFO(60, 0xd000, 9, 1, 0),
	MTK_PIN_INFO(61, 0xd000, 10, 1, 0),
	MTK_PIN_INFO(62, 0xd000, 11, 1, 0),
	MTK_PIN_INFO(63, 0xd000, 12, 1, 0),
	MTK_PIN_INFO(64, 0xd000, 13, 1, 0),
	MTK_PIN_INFO(65, 0xd000, 14, 1, 0),
	MTK_PIN_INFO(66, 0xd000, 15, 1, 0),
	MTK_PIN_INFO(67, 0xd000, 16, 1, 0),
	MTK_PIN_INFO(68, 0xd000, 17, 1, 0),
	MTK_PIN_INFO(69, 0xd000, 18, 1, 0),
	MTK_PIN_INFO(70, 0xe000, 0, 1, 0),
	MTK_PIN_INFO(71, 0xe000, 1, 1, 0),
	MTK_PIN_INFO(72, 0xe000, 2, 1, 0),
	MTK_PIN_INFO(73, 0xe000, 3, 1, 0),
	MTK_PIN_INFO(74, 0xe000, 4, 1, 0),
	MTK_PIN_INFO(75, 0xe000, 5, 1, 0),
	MTK_PIN_INFO(76, 0xe000, 6, 1, 0),
	MTK_PIN_INFO(77, 0xe000, 7, 1, 0),
	MTK_PIN_INFO(78, 0xe000, 8, 1, 0),
};

static const struct mtk_pin_info mtk_pin_info_smt[] = {
	MTK_PIN_INFO(0, 0x8100, 0, 1, 0),
	MTK_PIN_INFO(1, 0x8100, 1, 1, 0),
	MTK_PIN_INFO(2, 0x8100, 2, 1, 0),
	MTK_PIN_INFO(3, 0x8100, 3, 1, 0),
	MTK_PIN_INFO(4, 0x8100, 4, 1, 0),
	MTK_PIN_INFO(5, 0x8100, 5, 1, 0),
	MTK_PIN_INFO(6, 0x8100, 6, 1, 0),
	MTK_PIN_INFO(7, 0x8100, 7, 1, 0),
	MTK_PIN_INFO(8, 0x8100, 8, 1, 0),
	MTK_PIN_INFO(9, 0x8100, 9, 1, 0),
	MTK_PIN_INFO(10, 0x8100, 10, 1, 0),
	MTK_PIN_INFO(11, 0x9100, 0, 1, 0),
	MTK_PIN_INFO(12, 0x9100, 1, 1, 0),
	MTK_PIN_INFO(13, 0x9100, 2, 1, 0),
	MTK_PIN_INFO(14, 0x9100, 3, 1, 0),
	MTK_PIN_INFO(15, 0x9100, 4, 1, 0),
	MTK_PIN_INFO(16, 0x9100, 5, 1, 0),
	MTK_PIN_INFO(17, 0x9100, 6, 1, 0),
	MTK_PIN_INFO(18, 0x9100, 7, 1, 0),
	MTK_PIN_INFO(19, 0xa100, 0, 1, 0),
	MTK_PIN_INFO(20, 0xa100, 1, 1, 0),
	MTK_PIN_INFO(21, 0xa100, 2, 1, 0),
	MTK_PIN_INFO(22, 0xa100, 3, 1, 0),
	MTK_PIN_INFO(23, 0xa100, 4, 1, 0),
	MTK_PIN_INFO(24, 0xa100, 5, 1, 0),
	MTK_PIN_INFO(25, 0xa100, 6, 1, 0),
	MTK_PIN_INFO(26, 0xa100, 7, 1, 0),
	MTK_PIN_INFO(27, 0xa100, 8, 1, 0),
	MTK_PIN_INFO(28, 0xa100, 9, 1, 0),
	MTK_PIN_INFO(29, 0xa100, 10, 1, 0),
	MTK_PIN_INFO(30, 0xa100, 11, 1, 0),
	MTK_PIN_INFO(31, 0xa100, 12, 1, 0),
	MTK_PIN_INFO(32, 0xa100, 13, 1, 0),
	MTK_PIN_INFO(33, 0xb100, 0, 1, 0),
	MTK_PIN_INFO(34, 0xb100, 1, 1, 0),
	MTK_PIN_INFO(35, 0xb100, 2, 1, 0),
	MTK_PIN_INFO(36, 0xb100, 3, 1, 0),
	MTK_PIN_INFO(37, 0xb100, 4, 1, 0),
	MTK_PIN_INFO(38, 0xb100, 5, 1, 0),
	MTK_PIN_INFO(39, 0xb100, 6, 1, 0),
	MTK_PIN_INFO(40, 0xb100, 7, 1, 0),
	MTK_PIN_INFO(41, 0xb100, 8, 1, 0),
	MTK_PIN_INFO(42, 0xb100, 9, 1, 0),
	MTK_PIN_INFO(43, 0xb100, 10, 1, 0),
	MTK_PIN_INFO(44, 0xb100, 11, 1, 0),
	MTK_PIN_INFO(45, 0xb100, 12, 1, 0),
	MTK_PIN_INFO(46, 0xb100, 13, 1, 0),
	MTK_PIN_INFO(47, 0xb100, 14, 1, 0),
	MTK_PIN_INFO(48, 0xb100, 15, 1, 0),
	MTK_PIN_INFO(49, 0xc100, 0, 1, 0),
	MTK_PIN_INFO(50, 0xc100, 1, 1, 0),
	MTK_PIN_INFO(51, 0xd100, 0, 1, 0),
	MTK_PIN_INFO(52, 0xd100, 1, 1, 0),
	MTK_PIN_INFO(53, 0xd100, 2, 1, 0),
	MTK_PIN_INFO(54, 0xd100, 3, 1, 0),
	MTK_PIN_INFO(55, 0xd100, 4, 1, 0),
	MTK_PIN_INFO(56, 0xd100, 5, 1, 0),
	MTK_PIN_INFO(57, 0xd100, 6, 1, 0),
	MTK_PIN_INFO(58, 0xd100, 7, 1, 0),
	MTK_PIN_INFO(59, 0xd100, 8, 1, 0),
	MTK_PIN_INFO(60, 0xd100, 9, 1, 0),
	MTK_PIN_INFO(61, 0xd100, 10, 1, 0),
	MTK_PIN_INFO(62, 0xd100, 11, 1, 0),
	MTK_PIN_INFO(63, 0xd100, 12, 1, 0),
	MTK_PIN_INFO(64, 0xd100, 13, 1, 0),
	MTK_PIN_INFO(65, 0xd100, 14, 1, 0),
	MTK_PIN_INFO(66, 0xd100, 15, 1, 0),
	MTK_PIN_INFO(67, 0xd100, 16, 1, 0),
	MTK_PIN_INFO(68, 0xd100, 17, 1, 0),
	MTK_PIN_INFO(69, 0xd100, 18, 1, 0),
	MTK_PIN_INFO(70, 0xe100, 0, 1, 0),
	MTK_PIN_INFO(71, 0xe100, 1, 1, 0),
	MTK_PIN_INFO(72, 0xe100, 2, 1, 0),
	MTK_PIN_INFO(73, 0xe100, 3, 1, 0),
	MTK_PIN_INFO(74, 0xe100, 4, 1, 0),
	MTK_PIN_INFO(75, 0xe100, 5, 1, 0),
	MTK_PIN_INFO(76, 0xe100, 6, 1, 0),
	MTK_PIN_INFO(77, 0xe100, 7, 1, 0),
	MTK_PIN_INFO(78, 0xe100, 8, 1, 0),
};

static const struct mtk_pin_info mtk_pin_info_pullen[] = {
	MTK_PIN_INFO(0, 0x8400, 0, 1, 0),
	MTK_PIN_INFO(1, 0x8400, 1, 1, 0),
	MTK_PIN_INFO(2, 0x8400, 2, 1, 0),
	MTK_PIN_INFO(3, 0x8400, 3, 1, 0),
	MTK_PIN_INFO(4, 0x8400, 4, 1, 0),
	MTK_PIN_INFO(5, 0x8400, 5, 1, 0),
	MTK_PIN_INFO(6, 0x8400, 6, 1, 0),
	MTK_PIN_INFO(7, 0x8400, 7, 1, 0),
	MTK_PIN_INFO(8, 0x8400, 8, 1, 0),
	MTK_PIN_INFO(9, 0x8400, 9, 1, 0),
	MTK_PIN_INFO(10, 0x8400, 10, 1, 0),
	MTK_PIN_INFO(11, 0x9400, 0, 1, 0),
	MTK_PIN_INFO(12, 0x9400, 1, 1, 0),
	MTK_PIN_INFO(13, 0x9400, 2, 1, 0),
	MTK_PIN_INFO(14, 0x9400, 3, 1, 0),
	MTK_PIN_INFO(15, 0x9400, 4, 1, 0),
	MTK_PIN_INFO(16, 0x9400, 5, 1, 0),
	MTK_PIN_INFO(17, 0x9400, 6, 1, 0),
	MTK_PIN_INFO(18, 0x9400, 7, 1, 0),
	MTK_PIN_INFO(19, 0xa400, 0, 1, 0),
	MTK_PIN_INFO(20, 0xa400, 1, 1, 0),
	MTK_PIN_INFO(21, 0xa400, 2, 1, 0),
	MTK_PIN_INFO(22, 0xa400, 3, 1, 0),
	MTK_PIN_INFO(23, 0xa400, 4, 1, 0),
	MTK_PIN_INFO(24, 0xa400, 5, 1, 0),
	MTK_PIN_INFO(25, 0xa400, 6, 1, 0),
	MTK_PIN_INFO(26, 0xa400, 7, 1, 0),
	MTK_PIN_INFO(27, 0xa400, 8, 1, 0),
	MTK_PIN_INFO(28, 0xa400, 9, 1, 0),
	MTK_PIN_INFO(29, 0xa400, 10, 1, 0),
	MTK_PIN_INFO(30, 0xa400, 11, 1, 0),
	MTK_PIN_INFO(31, 0xa400, 12, 1, 0),
	MTK_PIN_INFO(32, 0xa400, 13, 1, 0),
	MTK_PIN_INFO(33, 0xb400, 0, 1, 0),
	MTK_PIN_INFO(34, 0xb400, 1, 1, 0),
	MTK_PIN_INFO(35, 0xb400, 2, 1, 0),
	MTK_PIN_INFO(36, 0xb400, 3, 1, 0),
	MTK_PIN_INFO(37, 0xb400, 4, 1, 0),
	MTK_PIN_INFO(38, 0xb400, 5, 1, 0),
	MTK_PIN_INFO(39, 0xb400, 6, 1, 0),
	MTK_PIN_INFO(40, 0xb400, 7, 1, 0),
	MTK_PIN_INFO(41, 0xb400, 8, 1, 0),
	MTK_PIN_INFO(42, 0xb400, 9, 1, 0),
	MTK_PIN_INFO(43, 0xb400, 10, 1, 0),
	MTK_PIN_INFO(44, 0xb400, 11, 1, 0),
	MTK_PIN_INFO(45, 0xb400, 12, 1, 0),
	MTK_PIN_INFO(46, 0xb400, 13, 1, 0),
	MTK_PIN_INFO(47, 0xb400, 14, 1, 0),
	MTK_PIN_INFO(48, 0xb400, 15, 1, 0),
	MTK_PIN_INFO(49, 0xc400, 0, 1, 0),
	MTK_PIN_INFO(50, 0xc400, 1, 1, 0),
	MTK_PIN_INFO(51, 0xd400, 0, 1, 0),
	MTK_PIN_INFO(52, 0xd400, 1, 1, 0),
	MTK_PIN_INFO(53, 0xd400, 2, 1, 0),
	MTK_PIN_INFO(54, 0xd400, 3, 1, 0),
	MTK_PIN_INFO(55, 0xd400, 4, 1, 0),
	MTK_PIN_INFO(56, 0xd400, 5, 1, 0),
	MTK_PIN_INFO(57, 0xd400, 6, 1, 0),
	MTK_PIN_INFO(58, 0xd400, 7, 1, 0),
	MTK_PIN_INFO(59, 0xd400, 8, 1, 0),
	MTK_PIN_INFO(60, 0xd400, 9, 1, 0),
	MTK_PIN_INFO(61, 0xd400, 10, 1, 0),
	MTK_PIN_INFO(62, 0xd400, 11, 1, 0),
	MTK_PIN_INFO(63, 0xd400, 12, 1, 0),
	MTK_PIN_INFO(64, 0xd400, 13, 1, 0),
	MTK_PIN_INFO(65, 0xd400, 14, 1, 0),
	MTK_PIN_INFO(66, 0xd400, 15, 1, 0),
	MTK_PIN_INFO(67, 0xd400, 16, 1, 0),
	MTK_PIN_INFO(68, 0xd400, 17, 1, 0),
	MTK_PIN_INFO(69, 0xd400, 18, 1, 0),
	MTK_PIN_INFO(70, 0xe400, 0, 1, 0),
	MTK_PIN_INFO(71, 0xe400, 1, 1, 0),
	MTK_PIN_INFO(72, 0xe400, 2, 1, 0),
	MTK_PIN_INFO(73, 0xe400, 3, 1, 0),
	MTK_PIN_INFO(74, 0xe400, 4, 1, 0),
	MTK_PIN_INFO(75, 0xe400, 5, 1, 0),
	MTK_PIN_INFO(76, 0xe400, 6, 1, 0),
	MTK_PIN_INFO(77, 0xe400, 7, 1, 0),
	MTK_PIN_INFO(78, 0xe400, 8, 1, 0),
};

static const struct mtk_pin_info mtk_pin_info_pullsel[] = {
	MTK_PIN_INFO(0, 0x8500, 0, 1, 0),
	MTK_PIN_INFO(1, 0x8500, 1, 1, 0),
	MTK_PIN_INFO(2, 0x8500, 2, 1, 0),
	MTK_PIN_INFO(3, 0x8500, 3, 1, 0),
	MTK_PIN_INFO(4, 0x8500, 4, 1, 0),
	MTK_PIN_INFO(5, 0x8500, 5, 1, 0),
	MTK_PIN_INFO(6, 0x8500, 6, 1, 0),
	MTK_PIN_INFO(7, 0x8500, 7, 1, 0),
	MTK_PIN_INFO(8, 0x8500, 8, 1, 0),
	MTK_PIN_INFO(9, 0x8500, 9, 1, 0),
	MTK_PIN_INFO(10, 0x8500, 10, 1, 0),
	MTK_PIN_INFO(11, 0x9500, 0, 1, 0),
	MTK_PIN_INFO(12, 0x9500, 1, 1, 0),
	MTK_PIN_INFO(13, 0x9500, 2, 1, 0),
	MTK_PIN_INFO(14, 0x9500, 3, 1, 0),
	MTK_PIN_INFO(15, 0x9500, 4, 1, 0),
	MTK_PIN_INFO(16, 0x9500, 5, 1, 0),
	MTK_PIN_INFO(17, 0x9500, 6, 1, 0),
	MTK_PIN_INFO(18, 0x9500, 7, 1, 0),
	MTK_PIN_INFO(19, 0xa500, 0, 1, 0),
	MTK_PIN_INFO(20, 0xa500, 1, 1, 0),
	MTK_PIN_INFO(21, 0xa500, 2, 1, 0),
	MTK_PIN_INFO(22, 0xa500, 3, 1, 0),
	MTK_PIN_INFO(23, 0xa500, 4, 1, 0),
	MTK_PIN_INFO(24, 0xa500, 5, 1, 0),
	MTK_PIN_INFO(25, 0xa500, 6, 1, 0),
	MTK_PIN_INFO(26, 0xa500, 7, 1, 0),
	MTK_PIN_INFO(27, 0xa500, 8, 1, 0),
	MTK_PIN_INFO(28, 0xa500, 9, 1, 0),
	MTK_PIN_INFO(29, 0xa500, 10, 1, 0),
	MTK_PIN_INFO(30, 0xa500, 11, 1, 0),
	MTK_PIN_INFO(31, 0xa500, 12, 1, 0),
	MTK_PIN_INFO(32, 0xa500, 13, 1, 0),
	MTK_PIN_INFO(33, 0xb500, 0, 1, 0),
	MTK_PIN_INFO(34, 0xb500, 1, 1, 0),
	MTK_PIN_INFO(35, 0xb500, 2, 1, 0),
	MTK_PIN_INFO(36, 0xb500, 3, 1, 0),
	MTK_PIN_INFO(37, 0xb500, 4, 1, 0),
	MTK_PIN_INFO(38, 0xb500, 5, 1, 0),
	MTK_PIN_INFO(39, 0xb500, 6, 1, 0),
	MTK_PIN_INFO(40, 0xb500, 7, 1, 0),
	MTK_PIN_INFO(41, 0xb500, 8, 1, 0),
	MTK_PIN_INFO(42, 0xb500, 9, 1, 0),
	MTK_PIN_INFO(43, 0xb500, 10, 1, 0),
	MTK_PIN_INFO(44, 0xb500, 11, 1, 0),
	MTK_PIN_INFO(45, 0xb500, 12, 1, 0),
	MTK_PIN_INFO(46, 0xb500, 13, 1, 0),
	MTK_PIN_INFO(47, 0xb500, 14, 1, 0),
	MTK_PIN_INFO(48, 0xb500, 15, 1, 0),
	MTK_PIN_INFO(49, 0xc500, 0, 1, 0),
	MTK_PIN_INFO(50, 0xc500, 1, 1, 0),
	MTK_PIN_INFO(51, 0xd500, 0, 1, 0),
	MTK_PIN_INFO(52, 0xd500, 1, 1, 0),
	MTK_PIN_INFO(53, 0xd500, 2, 1, 0),
	MTK_PIN_INFO(54, 0xd500, 3, 1, 0),
	MTK_PIN_INFO(55, 0xd500, 4, 1, 0),
	MTK_PIN_INFO(56, 0xd500, 5, 1, 0),
	MTK_PIN_INFO(57, 0xd500, 6, 1, 0),
	MTK_PIN_INFO(58, 0xd500, 7, 1, 0),
	MTK_PIN_INFO(59, 0xd500, 8, 1, 0),
	MTK_PIN_INFO(60, 0xd500, 9, 1, 0),
	MTK_PIN_INFO(61, 0xd500, 10, 1, 0),
	MTK_PIN_INFO(62, 0xd500, 11, 1, 0),
	MTK_PIN_INFO(63, 0xd500, 12, 1, 0),
	MTK_PIN_INFO(64, 0xd500, 13, 1, 0),
	MTK_PIN_INFO(65, 0xd500, 14, 1, 0),
	MTK_PIN_INFO(66, 0xd500, 15, 1, 0),
	MTK_PIN_INFO(67, 0xd500, 16, 1, 0),
	MTK_PIN_INFO(68, 0xd500, 17, 1, 0),
	MTK_PIN_INFO(69, 0xd500, 18, 1, 0),
	MTK_PIN_INFO(70, 0xe500, 0, 1, 0),
	MTK_PIN_INFO(71, 0xe500, 1, 1, 0),
	MTK_PIN_INFO(72, 0xe500, 2, 1, 0),
	MTK_PIN_INFO(73, 0xe500, 3, 1, 0),
	MTK_PIN_INFO(74, 0xe500, 4, 1, 0),
	MTK_PIN_INFO(75, 0xe500, 5, 1, 0),
	MTK_PIN_INFO(76, 0xe500, 6, 1, 0),
	MTK_PIN_INFO(77, 0xe500, 7, 1, 0),
	MTK_PIN_INFO(78, 0xe500, 8, 1, 0),
};

static const struct mtk_pin_info mtk_pin_info_drv[] = {
	MTK_PIN_INFO(0, 0x8600, 0, 4, 0),
	MTK_PIN_INFO(1, 0x8600, 4, 4, 0),
	MTK_PIN_INFO(2, 0x8600, 8, 4, 0),
	MTK_PIN_INFO(3, 0x8600, 12, 4, 0),
	MTK_PIN_INFO(4, 0x8600, 16, 4, 0),
	MTK_PIN_INFO(5, 0x8600, 20, 4, 0),
	MTK_PIN_INFO(6, 0x8600, 24, 4, 0),
	MTK_PIN_INFO(7, 0x8600, 28, 4, 0),
	MTK_PIN_INFO(8, 0x8610, 0, 4, 0),
	MTK_PIN_INFO(9, 0x8610, 4, 4, 0),
	MTK_PIN_INFO(10, 0x8610, 8, 4, 0),
	MTK_PIN_INFO(11, 0x9600, 0, 4, 0),
	MTK_PIN_INFO(12, 0x9600, 4, 4, 0),
	MTK_PIN_INFO(13, 0x9600, 8, 4, 0),
	MTK_PIN_INFO(14, 0x9600, 12, 4, 0),
	MTK_PIN_INFO(15, 0x9600, 16, 4, 0),
	MTK_PIN_INFO(16, 0x9600, 20, 4, 0),
	MTK_PIN_INFO(17, 0x9600, 24, 4, 0),
	MTK_PIN_INFO(18, 0x9600, 28, 4, 0),
	MTK_PIN_INFO(19, 0xa600, 0, 4, 0),
	MTK_PIN_INFO(20, 0xa600, 4, 4, 0),
	MTK_PIN_INFO(21, 0xa600, 8, 4, 0),
	MTK_PIN_INFO(22, 0xa600, 12, 4, 0),
	MTK_PIN_INFO(23, 0xa600, 16, 4, 0),
	MTK_PIN_INFO(24, 0xa600, 20, 4, 0),
	MTK_PIN_INFO(25, 0xa600, 24, 4, 0),
	MTK_PIN_INFO(26, 0xa600, 28, 4, 0),
	MTK_PIN_INFO(27, 0xa610, 0, 4, 0),
	MTK_PIN_INFO(28, 0xa610, 4, 4, 0),
	MTK_PIN_INFO(29, 0xa610, 8, 4, 0),
	MTK_PIN_INFO(30, 0xa610, 12, 4, 0),
	MTK_PIN_INFO(31, 0xa610, 16, 4, 0),
	MTK_PIN_INFO(32, 0xa610, 20, 4, 0),
	MTK_PIN_INFO(33, 0xb600, 0, 4, 0),
	MTK_PIN_INFO(34, 0xb600, 4, 4, 0),
	MTK_PIN_INFO(35, 0xb600, 8, 4, 0),
	MTK_PIN_INFO(36, 0xb600, 12, 4, 0),
	MTK_PIN_INFO(37, 0xb600, 16, 4, 0),
	MTK_PIN_INFO(38, 0xb600, 20, 4, 0),
	MTK_PIN_INFO(39, 0xb600, 24, 4, 0),
	MTK_PIN_INFO(40, 0xb600, 28, 4, 0),
	MTK_PIN_INFO(41, 0xb610, 0, 4, 0),
	MTK_PIN_INFO(42, 0xb610, 4, 4, 0),
	MTK_PIN_INFO(43, 0xb610, 8, 4, 0),
	MTK_PIN_INFO(44, 0xb610, 12, 4, 0),
	MTK_PIN_INFO(45, 0xb610, 16, 4, 0),
	MTK_PIN_INFO(46, 0xb610, 20, 4, 0),
	MTK_PIN_INFO(47, 0xb610, 24, 4, 0),
	MTK_PIN_INFO(48, 0xb610, 28, 4, 0),
	MTK_PIN_INFO(49, 0xc600, 0, 4, 0),
	MTK_PIN_INFO(50, 0xc600, 4, 4, 0),
	MTK_PIN_INFO(51, 0xd600, 0, 4, 0),
	MTK_PIN_INFO(52, 0xd600, 4, 4, 0),
	MTK_PIN_INFO(53, 0xd600, 8, 4, 0),
	MTK_PIN_INFO(54, 0xd600, 12, 4, 0),
	MTK_PIN_INFO(55, 0xd600, 16, 4, 0),
	MTK_PIN_INFO(56, 0xd600, 20, 4, 0),
	MTK_PIN_INFO(57, 0xd600, 24, 4, 0),
	MTK_PIN_INFO(58, 0xd600, 28, 4, 0),
	MTK_PIN_INFO(59, 0xd610, 0, 4, 0),
	MTK_PIN_INFO(60, 0xd610, 4, 4, 0),
	MTK_PIN_INFO(61, 0xd610, 8, 4, 0),
	MTK_PIN_INFO(62, 0xd610, 12, 4, 0),
	MTK_PIN_INFO(63, 0xd610, 16, 4, 0),
	MTK_PIN_INFO(64, 0xd610, 20, 4, 0),
	MTK_PIN_INFO(65, 0xd610, 24, 4, 0),
	MTK_PIN_INFO(66, 0xd610, 28, 4, 0),
	MTK_PIN_INFO(67, 0xd620, 0, 4, 0),
	MTK_PIN_INFO(68, 0xd620, 4, 4, 0),
	MTK_PIN_INFO(69, 0xd620, 8, 4, 0),
	MTK_PIN_INFO(70, 0xe600, 0, 4, 0),
	MTK_PIN_INFO(71, 0xe600, 4, 4, 0),
	MTK_PIN_INFO(72, 0xe600, 8, 4, 0),
	MTK_PIN_INFO(73, 0xe600, 12, 4, 0),
	MTK_PIN_INFO(74, 0xe600, 16, 4, 0),
	MTK_PIN_INFO(75, 0xe600, 20, 4, 0),
	MTK_PIN_INFO(76, 0xe600, 24, 4, 0),
	MTK_PIN_INFO(77, 0xe600, 28, 4, 0),
	MTK_PIN_INFO(78, 0xe610, 0, 4, 0),
};

/******************************************************************************
* GPIO Driver interface
******************************************************************************/
/*direction*/
int mt_set_gpio_dir(unsigned long pin, unsigned long dir);
int mt_get_gpio_dir(unsigned long pin);

/*pull select*/
int mt_set_gpio_pull_select(unsigned long pin, unsigned long select);
int mt_get_gpio_pull_select(unsigned long pin);

/*pull enable*/
int mt_set_gpio_pull_enable(unsigned long pin, unsigned long enable);
int mt_get_gpio_pull_enable(unsigned long pin);

/*input/output*/
int mt_set_gpio_out(unsigned long pin, unsigned long output);
int mt_get_gpio_out(unsigned long pin);
int mt_get_gpio_in(unsigned long pin);

/*mode control*/
int mt_set_gpio_mode(unsigned long pin, unsigned long mode);
int mt_get_gpio_mode(unsigned long pin);

/*drving control*/
int mt_set_gpio_drving(unsigned long pin, unsigned long drv);
int mt_get_gpio_drving(unsigned long pin);

/*schmitt trigger*/
int mt_set_gpio_smt(unsigned long pin, unsigned long enable);
int mt_get_gpio_smt(unsigned long pin);

/*ies*/
int mt_set_gpio_ies(unsigned long pin, unsigned long enable);
int mt_get_gpio_ies(unsigned long pin);

#ifndef CONFIG_SPL_BUILD
void mt_get_gpio_status_dump(void);
#endif
#endif
